<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/vue@next"></script>

    <div id="app">
        <div id= "endofbody">

        </div>

        
    </div>

    <script>
        const app = Vue.createApp({
            template: `
                <h1>Root instance</h1>
                <parent-component />
            `
        })

        app.component('parent-component', {
            template: `
                <h2>This is a parent component</h2>
                <teleport to="#endofbody">
                <child-component name="John" />
                </teleport>
            `
        })

        app.component('child-component', {
            props: ['name'],
            template: `
                <div>Hello, {{ name }}</div>
            `
        })

        app.mount('#app')
    </script>
</body>
</html>